package com.dq.order.client.fallback;

import com.dq.commonutils.dto.OrderUserVo;
import com.dq.order.client.UcenterClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @project: guli_parent
 * @ClassName: UcenterClientFallBack
 * @author: dq
 * @creat: 2022/8/17 17:09
 */
@Component
@Slf4j
public class UcenterClientFallBackFactory implements FallbackFactory <UcenterClient> {
    @Override
    public UcenterClient create(Throwable throwable) {
        return new UcenterClient() {
            @Override
            public OrderUserVo getOrderUserInfo(String userId) {
                log.error("--------------------");
                log.error("开启了UcenterClient的熔断降级功能 ");
                log.error("--------------------");
                return null;
            }
        };
    }
}
